﻿(function(){
	//if (!window.external) return;

	var $tag = function(tagName,obj){
		return (obj || document).getElementsByTagName(tagName);
	};
	// 遍历框架
	var TraverseFrames = function(win,fn){
		if (!win) return;
		fn(win);

		var o = win.frames;
		if (!o) return;
		for (var i=0,len=o.length; i<len; i++){
			TraverseFrames(o[i], fn);
		}
	};

	TraverseFrames(window, function(win){
		var doc = win.document;
		if (!doc) return;

		var o = $tag('img',doc);
		for (var i=0,len=o.length; i<len; i++){
			var src = o[i].src;
			o[i].src = src;
		}
	});
})();
